package tw.edu.tku.im.maze;
import org.json.JSONException;
import org.json.JSONObject;


public class HeartBeatRepParser extends PacketParser {
   public static HeartBeatRepParser INSTANCE = new HeartBeatRepParser();
   
   private HeartBeatRepParser() { }
   
   @Override
   public HeartBeatRep parse(JSONObject jsonObj) throws JSONException {
      JSONObject result = jsonObj.getJSONObject("result");
      return new HeartBeatRep(result.getInt("state"));
   }

   @Override
   public String acceptName() {
      return "heartBeatResponse";
   }

}
